package edu.xpu.compute.recommend.entity;

import java.io.Serializable;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 用户和图书的联合主键
 * @author liukang
 * @date 2019年10月30日
 */
@Getter
@Setter
@NoArgsConstructor
public class UserBookUnionPk implements Serializable {
	private static final long serialVersionUID = 1L;
	/*
	 * 用户id
	 */
	private Long userGuid;
	/*
	 * 图书id
	 */
	private Long bookGuid;
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((bookGuid == null) ? 0 : bookGuid.hashCode());
		result = prime * result
				+ ((userGuid == null) ? 0 : userGuid.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserBookUnionPk other = (UserBookUnionPk) obj;
		if (bookGuid == null) {
			if (other.bookGuid != null)
				return false;
		} else if (!bookGuid.equals(other.bookGuid))
			return false;
		if (userGuid == null) {
			if (other.userGuid != null)
				return false;
		} else if (!userGuid.equals(other.userGuid))
			return false;
		return true;
	}

}
